import request from "@/utils/service"
import type * as Information from "./types/index"

/** 后台系统操作日志列表 */
export function getBackgroundListApi(params: Information.IInformationListParams) {
  return request<Information.InformationListResponseData<Information.IInformationListData[]>>({
    url: "/api/v2/weblog/lists",
    method: "get",
    params
  })
}

/** 终端系统操作日志列表 */
export function getTerminalListApi(params: Information.IInformationListParams) {
  return request<Information.InformationListResponseData<Information.ITerminalListData[]>>({
    url: "/api/v2/deviceLogs/getLogs",
    method: "get",
    params
  })
}

/** 后台系统操作日志列表导出 */
export function exportBackgroundApi(params: Information.IInformationListParams) {
  return request<Blob>({
    url: "/api/v2/weblog/listsexcel",
    method: "get",
    params,
    responseType: "blob"
  })
}

/** 终端系统操作日志列表导出 */
export function exportTerminalApi(params: Information.IInformationDeviceExportParams) {
  return request<Blob>({
    url: "/api/v2/deviceLogs/listsexcel",
    method: "get",
    params,
    responseType: "blob"
  })
}
